<%@ page import="edu.uow.devdocs.Issue" %>

<table class="searchable tableForm">
  <tr>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'task', 'error')}"><label for="description"><g:message code="developmentTask.description.label" default="Task" /></label></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'task', 'error')}"><g:textField name="task" maxlength="255" value="${developmentTaskInstance?.task}"/></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'priority', 'error')} required"><label for="priority"><g:message code="developmentTask.priority.label" default="Priority" /> <span class="required-indicator">*</span></label></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'priority', 'error')} required"><g:select name="priority" from="${1..5}" class="range" required="" value="${fieldValue(bean: developmentTaskInstance, field: 'priority')}"/></td>
  </tr>
  <tr>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'reference', 'error')}"><label for="reference"><g:message code="developmentTask.reference.label" default="Reference Number" /></label></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'reference', 'error')}"><g:textField name="reference" maxlength="20" value="${developmentTaskInstance?.reference}"/></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'deployment', 'error')}"><label for="deployment"><g:message code="developmentTask.deployment.label" default="Deployment" /></label></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'deployment', 'error')}"><g:select id="deployment" name="deployment.id" from="${edu.uow.devdocs.Deployment.active().list()}" optionKey="id" value="${developmentTaskInstance?.deployment?.id}" class="many-to-one" noSelection="['null': '']"/></td>
  </tr>
  <tr>
    <td class="fieldcontain ${hasErrors(bean: timeTrackerInstance, field: 'dateRequired', 'error')} required"><label for="dateRequired"><g:message code="timeTracker.dateRequired.label" default="Date Required" /> <span class="required-indicator">*</span></label></td>
    <td class="fieldcontain ${hasErrors(bean: timeTrackerInstance, field: 'dateRequired', 'error')} required"><g:jqDatePicker name="dateRequired" precision="day" value="${timeTrackerInstance?.dateRequired}" /></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'project', 'error')} required"><label for="project"><g:message code="developmentTask.project.label" default="Project" /> <span class="required-indicator">*</span></label></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'project', 'error')} required"><g:select id="project" name="project.id" from="${edu.uow.devdocs.Project.list()}" optionKey="id" required="" value="${developmentTaskInstance?.project?.id}" class="many-to-one"/></td>
  </tr>
  <tr>
    <td class="fieldcontain required"><label for="issue"><g:message code="developmentTask.issue.label" default="Issue" /> <span class="required-indicator">*</span></label></td>
    <td class="fieldcontain required"><g:hiddenField name="issue.id" value="${developmentTaskInstance?.issue?.id }"/><g:link controller="issue" action="edit" id="${developmentTaskInstance?.issue?.id }">${developmentTaskInstance?.issue }</g:link></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'status', 'error')} required"><label for="status"><g:message code="developmentTask.status.label" default="Status" /> <span class="required-indicator">*</span></label></td>
    <td class="fieldcontain ${hasErrors(bean: developmentTaskInstance, field: 'status', 'error')} required"><g:select id="status" name="status.id" from="${edu.uow.devdocs.DevelopmentTaskStatus.list()}" optionKey="id" required="" value="${developmentTaskInstance?.status?.id}" class="many-to-one"/></td>
  </tr>
  <tr>
    <td></td>
    <g:if test="${developmentTaskInstance?.deployment}">
    <td><g:link class="show_deployment button" controller="deployment" action="edit" id="${developmentTaskInstance?.deployment?.id }"><g:message code="default.edit.label" args="['Deployment']" /></g:link></td>
    </g:if>
    <td></td>
    <td><g:link class="resolve button" action="resolve" id="${developmentTaskInstance?.id }"><g:message code="default.resolve.label" args="[entityName]" /></g:link></td>
  </tr>
</table>
